import {useEffect} from 'react'
import {useDispatch,useSelector} from 'react-redux'
const ShopcartList=()=>{
    const list=useSelector(state=>{
        return state.shopcart.rows  
    })
    console.log('list',list);
    
    const dispatch=useDispatch()
    useEffect(()=>{
        //组件中使用dipatch向dva中发送action通知
        //这个action通知的type的值:模块名/生成器的函数名
        dispatch({type:'shopcart/getShopcartListAsync'})
    },[])
    return(
    <>
        <h2>购物车</h2>
    </>)
}
export default ShopcartList